<html>
<head><meta charset="utf-8"><title>const_generic trait bound deduction · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/const_generic.20trait.20bound.20deduction.html">const_generic trait bound deduction</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="226306686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/const_generic%20trait%20bound%20deduction/near/226306686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexandros Liarokapis <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/const_generic.20trait.20bound.20deduction.html#226306686">(Feb 14 2021 at 14:24)</a>:</h4>
<p>Hi all, I also posted a question on <a href="https://users.rust-lang.org/t/failure-to-deduce-bound-when-using-const-generics-and-generic-associated-types/55592">https://users.rust-lang.org/t/failure-to-deduce-bound-when-using-const-generics-and-generic-associated-types/55592</a> but figured I would probably get a faster and more correct answer here. Basically I am trying to figure out if I should expect the snippet to compile once the const_generics feature is completed. I would expect that the trait bound would be auto-deduced since it can be fully evaluated but from the paragraph on the RFC I think it's meant to work this way. Also using parameter deduction for the single statement on the final create function leads to ICE.</p>



<a name="226324822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/const_generic%20trait%20bound%20deduction/near/226324822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/const_generic.20trait.20bound.20deduction.html#226324822">(Feb 14 2021 at 21:06)</a>:</h4>
<p>clippy currently passes this code though it might add more lints in the future</p>



<a name="226325417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/const_generic%20trait%20bound%20deduction/near/226325417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kentrixy <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/const_generic.20trait.20bound.20deduction.html#226325417">(Feb 14 2021 at 21:21)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281739">oliver</span> <a href="#narrow/stream/122651-general/topic/const_generic.20trait.20bound.20deduction/near/226324822">said</a>:</p>
<blockquote>
<p>clippy currently passes this code though it might add more lints in the future</p>
</blockquote>
<p>I think it is pretty close, I will do more read up on it. Cheers</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>